package cm.day08;

import java.util.*;

public class Test9 {
    public static void main(String[] args) {
        Map<String, Map<String, String>> bigMap = new HashMap<>();
        // 2.创建两个小Map集合对象,代表教室(小容器),泛型: 键: String 值: String
        Map<String, String> map1 = new HashMap<>();
        Map<String, String> map2 = new HashMap<>();
        //分别在map集合中存储对象
        map1.put("001", "李晨");
        map1.put("002", "范冰冰");
        map2.put("001", "马云");
        map2.put("002", "马化腾");
        //把两个Map集合存储到一个大的集合
        bigMap.put("Java基础班", map1);
        bigMap.put("Java就业班", map2);
        //利用迭代器还有增强for循环
        Set<Map.Entry<String, Map<String, String>>> set = bigMap.entrySet();
        for (Map.Entry<String, Map<String, String>> stringMapEntry : set) {
            //获取当前对象的Key值
            String Classname = stringMapEntry.getKey();
            System.out.println(Classname);
            //获取当前对象的Value值
            Map<String, String> map3 = stringMapEntry.getValue();
             //利用迭代器和增强for循环
            Set<Map.Entry<String, String>> set1 = map3.entrySet();
            for (Map.Entry<String, String> stringStringEntry : set1) {
                //获取Key和Value值
                String key = stringStringEntry.getKey();
                String value = stringStringEntry.getValue();
                System.out.println(key + "  " + value);
            }
        }
    }
}
